<template>
	<!-- 遮罩层下面禁止滚动事件 uni-app方法 @touchmove.stop.prevent="ontouchstart" -->
	<view class="index" @touchmove.stop.prevent="ontouchstart">
		<view class="modal-box">
			<image class="img" :src="ModealList.img" mode="scaleToFill"></image>
			<image @click="offClick" class="cw" src="../../static/images/my/modal-cw.png" mode=""></image>
			<view class="title">{{ModealList.title}}</view>
			<view class="btn">
				<view class="left" @click="cancelClick">
					{{ModealList.cancel}}
				</view>
				<view class="right" @click="confirmClick">
					{{ModealList.confirm}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"ModalBox",
		props: {
		    ModealList:{
		      type: Object,
		      default(){
		        return {}
		      }
		    }
		},
		data() {
			return {
				
			};
		},
		methods:{
			// 关闭
			offClick(){
				this.$emit('offClick')
			},
			// 取消
			cancelClick(){
				this.$emit('cancelClick')
			},
			// 确定
			confirmClick(){
				this.$emit('confirmClick')
			},
			// 遮罩层下面禁止滚动事件
			ontouchstart(e) {
				
			}
		}
	}
</script>

<style lang="less" scoped>
	.index{
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100vh;
		background: rgba(0,0,0,0.4);
		z-index: 9999;
	}
	.modal-box{
		width: 600rpx;
		top: 50%;
		left:50%;
		transform: translate(-50%,-50%);
		height: 591rpx;
		background-color: #ffffff;
		border-radius: 6rpx;
		position: absolute;
		.img{
			border-radius: 6rpx;
			width: 100%;
			height: 327rpx;
		}
		.cw{
			position: absolute;
			top: -20rpx;
			right: -20rpx;
			width: 52rpx;
			height: 52rpx;
		}
		.title{
			margin-top: 50rpx;
			text-align: center;
			font-family: PingFang-SC-Bold;
			font-size: 32rpx;
			font-weight: 600;
			font-stretch: normal;
			letter-spacing: 0rpx;
			color: #333333;
		}
		.btn{
			margin-top: 50rpx;
			padding: 0 90rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.left{
				text-align: center;
				width: 181rpx;
				height: 53rpx;
				line-height: 53rpx;
				border-radius: 24rpx;
				border: solid 1rpx #666666;
				font-family: PingFangSC-Regular;
				font-size: 26rpx;
				font-weight: normal;
				font-stretch: normal;
				letter-spacing: 0rpx;
				color: #666666;
			}
			.right{
				text-align: center;
				width: 181rpx;
				height: 53rpx;
				line-height: 53rpx;
				background-color: #507aff;
				border-radius: 24rpx;
				font-family: PingFangSC-Regular;
				font-size: 26rpx;
				font-weight: normal;
				font-stretch: normal;
				letter-spacing: 0rpx;
				color: #ffffff;
			}
		}
	}
</style>
